home *** CD-ROM | disk | FTP | other *** search
-
- BAT-HINT # 1
-
- **************************************************************************
-
- from the BATHINTS library... part of the BATPOWER CONFERENCE from:
-
- THE PAINFRAME OPUS/FIDO 261/1004
-
- Baltimore, Maryland 1-301-488-7461
-
- **************************************************************************
-
- The COMMAND command
-
- Command.com is an executable program just like all other .com files in DOS.
- Running the COMMAND command invokes a secondary command processor, using up
- about 3.2Kbytes of RAM. There are three optional parameters in DOS 3.1:
-
- /p will permanently (until reboot) load the secondary command processor
- /c allows you to pass a STRING to the secondary command processor
- /e sets the environment size
-
- The /p parameter finds its greatest use when employed in the config.sys
- file to expand the environment. For example:
-
- shell=command.com /e:62 /p [DOS 3.1] or
- shell=command.com /e:32768 /p [DOS 3.2 & 3.3]
-
- will permanently expand the environment to the maximum 992-odd bytes
- allowable in DOS 3.1 (62 x 16 = 992) or 32768 bytes in DOS 3.2 or 3.3. This
- is very useful when long paths, many environmental variables or programs
- employing user defined environmental variables (i.e. answer.com... see
- BATPOWER.ARC) are used.
-
- When COMMAND is run without any parameters, the new command processor fully
- embraces the environment of the previous command processor. So expanding
- the environment by issuing one of the config.sys commands shown above will
- also result in an equally expanded environment in any subsequent command
- processor. The environment of the second command processor is alterable,
- however, through the SET command... and changes to the environment of the
- secondary command processor will not affect the environment of the primary
- command processor. Thus, if you normally employ a long path but
- occasionally want to modify the path for a special application, you need
- only enter
-
- command
- set path=[your new path]
-
- to invoke a new path in the secondary command processor. All other
- environmental variables will remain the same. To return to the original
- path and command processor, just type
-
- exit
-
- at the DOS prompt. Your original path will be intact.
-
- Use of COMMAND /C is very useful for calling a batch file from another
- batch file. Normally, if you enter the name of a batch file from within a
- batch file, the second batch file will be executed but you will be unable
- to return to the first batch file. While this limitation has been overcome
- in versions of DOS >3.1 (using the CALL command), many people are still
- running 3.1. To call another batch file from within a batch file in DOS 3.1
- enter the following line in the first batch file:
-
- command /c batname
-
- BATNAME.bat will be executed and will return to the next line in the
- original bat file. Alternatively, you could enter
-
- command batname
-
- Again, BATNAME will be executed... but this time reentry into the first bat
- file is accomplished with the EXIT command. The EXIT command could be
- placed at the end of the second bat file or at some other location in the
- second bat file executable upon a conditional statement.
-
- *********************************************************** David Creasey